#ifndef __TMPBUF_H__
#define __TMPBUF_H__
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define TMPBUF_MAX 256

    typedef struct tmpbuf_st
    {
        char tmp[TMPBUF_MAX];
        char *buf;
        size_t cap;
    } tmpbuf_t;
	#define TMPBUF() {{0},NULL,0}
    extern int tmpbuf_init(tmpbuf_t *buf, size_t cap);
    extern void tmpbuf_deinit(tmpbuf_t *buf);

#ifdef __cplusplus
}
#endif

#endif